#include<iostream>
#include<cstring>
using namespace std;
int N,S;
int C[10005],Y[10005];
int main(){
    //Yogurt factory
    cin>>N>>S;
    for(int i=1;i<=N;i++){
        cin>>C[i]>>Y[i];
    }
    long long res=0;
    for(int i=1;i<=N;i++){
        int mintemp=C[i];
        for(int j=1;j<i;j++){            
           mintemp=min(mintemp,C[j]+S*(i-j));            
        }
        res+=Y[i]*mintemp;
    }
    cout<<res<<endl;
    return 0;
}